import java.util.Random;
import java.util.Scanner;

public class Game {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner input = new Scanner(System.in);
        while (true) {
            System.out.println("+==========随机数游戏===========+");
            System.out.println("请输入10以内的随机数来验证你是否猜对");
            int num1 = random.nextInt(10);
            int num2 = input.nextInt();
            if (num1 == num2) {
                System.out.println("哇！猜对了");
                return;
            }else {
                System.out.println("猜错啦啊"+"生成的随机数是" + num1 +"，再来一次吧");
            }






        }
    }
}
